<?php
require('../../../global.php');
$expertID = $db->get('tb_order', 'class_id', array('tbid' => $_GET['oid']));

?>
<!DOCTYPE html>
<html>
<head>
    <?php require('admin/_head.php'); ?>
    <title>课程管理 - <?php echo getconfig('title'); ?>管理后台</title>
        <link href="<?php echo SITEROOTURL; ?>/admin/js/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
</head>
<body class="gray-bg">


							<div id="reservebox" style="padding:20px;position: absolute;right:49px;">
                           
                                <div class="form-group row">
                                    <label class="col-sm-3 control-label">　　　预约时间</label>
                                    <div class="col-sm-9">
                                        
                                    </div>
                                </div>
                                <div class="form-group row">
                                    
                                    <div class="col-sm-9">
                                        <input type="text" name="reserve_time" id="reserve_time" placeholder="请输入预约时间" class="form-control-static" value="" >
                                    </div>
                                </div>
                                <input type="hidden"  class="form-control" id="delivery_type" value="1"/>
                                

                                    
                                <div  style="">
                                    </br></br> </br></br>
                                </div>
                                
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                       

                                        <button class="btn btn-primary btn-lg closelayer" type="button" id="submit">确定</button>
                                        <button class="btn btn-white btn-lg closelayer" type="button" id="cancer">取消</button>
                                    </div>
                                </div>
                            
                        </div>
    <?php require('admin/_js.php'); ?>
    <script src="<?php echo SITEROOTURL; ?>/admin/js/content.js?v=1.0.0"></script>

    <script src="<?php echo SITEROOTURL; ?>/admin/js/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script src="<?php echo SITEROOTURL; ?>/admin/js/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <script>
    $(function(){
    	var closeLayer = function() {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.closeLayer(index);
        }

    	$('#reserve_time').datetimepicker({
            language : 'zh-CN',
            format : 'yyyy-mm-dd hh:ii',
            weekStart : 1,
            startView : 2,
            todayHighlight : true,
            autoclose : true
        });
    	$('#cancer').click(function(event){
    		closeLayer();
        }); 
    	$('#submit').click(function(event){
    		$.ajax({
                url: 'ajax.php',
                type: 'POST',
                dataType: 'json',
                data: {
                    ac: 'reserve',
                    reserve_time: $('#reserve_time').val(),
                    oid: <?php echo $_GET['oid'];?>,
                    eid: <?php echo $expertID;?>,
                }
            }).done(function(data){
                if(data.status == 'y'){
                    parent.swal('操作成功', '', 'success');
                    closeLayer();
                } else {
                    parent.swal('操作失败', data.message, 'error');
                    closeLayer();
                }
            	
            }).fail(function(){
                //parent.
            	parent.swal('操作失败', '出现问题,请查询管理员或重新操作', 'error');
                    closeLayer();
            });
            
        });
        
    });
    </script>
</body>
</html>
